<template>
  <div class="content_box">
    <div class="list_box">
      <div class="box" @click="resetPass">
        <p class="text">更改密码</p>
        <van-icon color="#999" name="arrow" />
      </div>
      <div class="box" @click="toXieyi">
        <p class="text">协议</p>
        <van-icon color="#999" name="arrow" />
      </div>
      <div class="box" @click="toXieyi">
        <p class="text">关于我们</p>
        <van-icon color="#999" name="arrow" />
      </div>
      <div class="box" @click="toUpData">
        <p class="text">更新数据</p>
        <van-icon color="#999" name="arrow" />
      </div>
    </div>
    <div class="outLogin_box">
      <p class="outLogin" @click="outLogin">退出登录</p>
    </div>
  </div>
</template>

<script>
import { 
  removeToken,
  removeRefreshToken
} from "@/utils/auth";
export default {
  data() {
    return {
      statusBarHeight: "", // 状态栏高度
      titleBarHeight: "", // 标题栏高度
      navBarHeight: "", // 导航栏总高度
      moneyNum:'0.00',
      userPhone:'',
      assetsMsg:{},// 我的资产
      iskefu:false,
      myStore:{}
    };
  },
  methods: {

    // 跳转更新数据
    toUpData(){
      wx.navigateTo({
        url: `/pages/my/set/updata/main`,
      });
    },

    // 跳转协议
    toXieyi(){
      this.$toast('该功能即将开放！')
      return
      wx.navigateTo({
        url: `/pages/my/set/xieyi/main`,
      });
    },

    // 重置密码
    resetPass(){
      this.$toast('该功能即将开放！')
      return
      wx.navigateTo({
        url: `/pages/login/forgot_pass/main`,
      });
    },

    // 退出登录
    outLogin(){
      wx.showModal({
        title: '温馨提示',
        content: '确定退出登录',
        success: (res)=>{
          if (res.confirm) {
            removeToken()
            removeRefreshToken()
            wx.reLaunch({
              url: `/pages/login/main`,
            });
            this.$toast('已退出登录~')
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
    },
  },
  
  onShow() {
  },
  onLoad() {
  },

};
</script>

<style lang="scss" scoped>
.content_box {
  height: 100vh;
  background: #F5F5F5;  
  padding-top:30rpx;
  .list_box{
    margin:0 30rpx;
    .box{
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 110rpx;
      font-size:30rpx;
      padding:0 30rpx;
      background: #fff;
      margin-bottom:20rpx;
      border-radius: 10rpx;
      font-size:30rpx;
      color:#222;
    }
  }
  .outLogin_box{
    position: fixed;
    bottom:50rpx;
    width: 100%;
    .outLogin{
      width: 80%;
      height: 90rpx;
      line-height: 90rpx;
      border:1px solid #3176FE;
      color:#3176FE;
      font-weight: 500;
      background: #fff;
      margin:30rpx auto;
      border-radius: 6rpx;
      text-align: center;
      font-size:32rpx;
    }
  }
  
}
</style>